<?xml version = '1.0' encoding = 'UTF-8'?>
<HBRRepo><variables/><rulesets/><rules><rule id="1" name="Copy Parent Level Prediction" product="Planning"><property name="application">Vision</property><property name="plantype">Plan1</property><script type="groovy">// Step 1: Get the cube and initialize variables
def cube = operation.application.getCube("Plan1")

// Step 2: Define Accounts and Copy Values

String finalCalc;
String periods, accounts,account;
StringBuilder cscript = new StringBuilder();

try {
List &lt; String > povMemberNames = operation.grid.pov*.essbaseMbrName
finalCalc = """ Fix("${povMemberNames.join('", "')}") """
	cscript.append(finalCalc )
 		operation.grid.dataCellIterator.each {DataCell cell ->        
 		periods = cell.periodName
        accounts= cell.getAccountName()
        double chgValue = cell.getData()
      /*  println(accounts+":"+chgValue);*/
        if (accounts == "7003")
			{ 
            account="7460"
         		finalCalc = """        
						  Fix("$periods")
                         "Predicted" (
                         	@CREATEBLOCK("Predicted");
						  "$account" = $chgValue;
                          )
						  Endfix
							"""	
                cscript.append(finalCalc)
 		  }   
           if (accounts == "7004")
			{ 
            account="7625"
         		finalCalc = """        
						  Fix("$periods","Predicted")
						  "$account" = $chgValue;
						  Endfix
							"""	
                cscript.append(finalCalc)
 		  }  
             if (accounts == "7005")
			{ 
            account="7699"
         		finalCalc = """        
						  Fix("$periods","Predicted")
						  "$account" = $chgValue;
						  Endfix
							"""	
                cscript.append(finalCalc)
 		  }   
     
 }
 cscript.append("EndFix")
 
 
/*println(cscript.toString())*/
 return cscript.toString()

}
catch (Exception e) {
    println("Error while copying data: " + e.message)
    e.printStackTrace()
}
</script></rule></rules><components/><deployobjects><deployobject product="2" application="vision" plantype="plan1" obj_id="1" obj_type="1" name="COPY PARENT LEVEL PREDICTION"/></deployobjects></HBRRepo>